home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
CMDGeneral
/
DESOTO14.1.SDA
/
SMARTBOOT V1.3
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
3KB
|
122 lines
50 POKE53280,11:POKE53281,0:POKE646,15
95 REM SMARTBOOT V1.3
100 A$="PROGRAMNAME.....":REM TARGET PROGRAM
105 AA$="PROGRAM.TITLE"
110 RU$="RUN":REM OR "SYSXXXXX"
115 LD$=",1": REM "" FOR BASIC PROGRAMS
120 TD=8:REM PROGRAM DISK BECOMES DEVICE #
125 REM PRINTER CODES
130 PR=1:REM PRINTER SWITCH:1=ON/0=OFF
135 P(1)=0 :P(2)=0 :P(3)=0 :P(4)=0 :P(5)=0 :P(6)=0 :P(7)=0 :P(8)=0 :P(9)=0
140 JD=1:SR=0: REM JIFFY DOS?: SELF-RUN?
145 DF=0:REM DATA DISK? 1=YES/0=NO
150 DD=9:REM DATA DISK BECOMES DEVICE #
155 NF$="FILENAME........":REM IDENTIFIER FILE ON DATA DISK
160 FT$="P":REM FILE TYPE OF IDENTIFIER (P,S,U,R)
165 SP= 0:REM HD PART # FOR SYSTEMINFO
170 REM LIST 180- FOR ADDITIONAL OPTIONSREM(null)
175 GOTO230
180 P1=1:REM OPTIONAL HD PARTITION NUMBER
185 PA$=":81PART.NAME.....":REM OR HD DIR PATH
190 REM: PRINT#15,"C[208]"+CHR$(P1):REM HD PART
195 REM: PRINT#15,"CD"+PA$:REM HD DIR PATH
200 REM: PRINT#15,"I":FORT=1TO700:NEXT:REM 81 ROOT
205 REM: PRINT#15,"/"+PA$:FORT=1TO700:NEXT:REM 81 PART
210 REM(null)
215 GOSUB615:IFEN>19THEN630
220 RETURN
225 :
230 RD=17:REM DEVICE# TO BEGIN TEMPORARY CONFIGURATION
235 SI$="SYSTEMINFO.SMR":REM FILE NAME FOR SYSTEM INFO
240 :
245 NF$=NF$+","+FT$+",R"
250 CM=1:REM CHECK DEVICE & IF HD
255 DN=PEEK(186):X$=""
260 OPEN15,DN,15:PRINT#15,"M-R"CHR$(160)CHR$(254)CHR$(6)
261 FORI=1TO6:GET#15,B$:X$=X$+B$:NEXT
262 IFX$="CMD HD"THENCM=1
263 IFX$="CMD RL"THENCM=2
265 :
270 IFCM=0THEN295
275 REM FIND HD PARTITION #
280 PRINT#15,"G-P":GET#15,I$:GET#15,I$:GET#15,I$:CLOSE15
285 PN=ASC(I$)
290 :
295 G=0:REM CHECK FOR GEOS
300 G$="":FORX=49158TO49166:G$=G$+CHR$(PEEK(X)):NEXT:IFG$="GEOS BOOT"THENG=1
305 FORX=49152TO49172:POKEX,0:NEXT
310 :
315 X=1:PRINT"[147]POLLING"
320 FORT=8TO29:IFT=14THEN335
325 :OPEN5,T,5:CLOSE5:IFST<>0THEN335
330 :D(X)=T:X=X+1
335 :NEXT:Z=X-1
340 :
345 PRINT"BUFFERING"
350 FORX=1TOZ
355 :OD=D(X):ND=(RD-1)+X:GOSUB530
360 :IF D(X)=DN THEN DV=ND:Y=X
365 :D$(X)=STR$(OD)+STR$(ND)
370 :D(X)=ND:NEXT
375 :
380 X=1:PRINT"CONFIGURING"
385 IF DF THENGOSUB550
390 OD=DV:ND=TD:GOSUB530
395 D$(Y)=STR$(DN)+STR$(ND):D(Y)=ND
400 :
405 FORT=1TOZ:D$(T)=MID$(D$(T),2,2)+RIGHT$(D$(T),2):NEXT
410 :
415 PRINT"SAVING"
420 OPEN15,TD,15:SI$=":"+SI$:IFCM=1 THEN SI$=STR$(SP)+SI$
425 GOSUB615:
430 PRINT#15,"S"+SI$:GOSUB615
435 OPEN5,TD,5,SI$+",S,W"
440 FORT=1TOZ
445 :PRINT#5,D$(T)
450 :NEXT:CR$=CHR$(13)
455 PRINT#5,STR$(-1)+CR$+STR$(G)+CR$+STR$(PN)+CR$
460 CLOSE5:GOSUB615
465 GOSUB615:GOSUB180:CLOSE15
470 :
475 IFPRTHENPRINT"PRINTER":GOSUB645
480 IFAA$="PROGRAM.TITLE"THEN495
485 PRINT"[147] NOW LOADING"
490 PRINT:PRINT;:FORT=1TO((40-LEN(AA$))/2):PRINT" ";:NEXT:PRINTAA$
495 POKE251,PEEK(646):POKE646,PEEK(53281)
500 PRINT"LOAD"CHR$(34)A$CHR$(34)","+STR$(TD)+LD$+":"
505 PRINT:PRINT:PRINT:PRINT
510 PRINT"POKE646,"PEEK(251)":PRINT"CHR$(34)"[147]"RU$":"CHR$(34)
512 Z8=5:IFSRTHENZ8=2
513 IFJDTHEN @#TD
515 POKE631,19:POKE632,13:POKE633,13:POKE634,19:POKE635,13:POKE198,Z8:NEW
520 :
525 REM CHANGE DEV #
530 OPEN15,OD,15:PRINT#15,"M-W"CHR$(119)CHR$(0)CHR$(2)CHR$(ND+32)CHR$(ND+64)
535 CLOSE15:RETURN
540 :
545 REM FIND DATA DISK
550 F=0:HF=1:FORT=1TOZ
555 :OPEN15,D(T),15:OPEN5,D(T),5,NF$:GOSUB615:CLOSE5:CLOSE15
560 :IFAB THEN EN=0:GOTO570
565 :IFEN=0THENOD=D(T):ND=DD:GOSUB530:D$(T)=LEFT$(D$(T),3)+STR$(ND):D(T)=ND
570 :IFEN=0THENT=Z:F=1
575 :NEXT
580 IF F=1THENHF=0:RETURN
585 PRINT"INSERT DATA DISK, PRESS A KEY (_TO EXIT)":AB=0
590 GETIN$:IFIN$=""THEN590
595 IFIN$="_"THENAB=1:RETURN
600 GOTO550
605 :
610 REM ERROR CHANNEL
615 INPUT#15,EN$,EM$,ET$,ES$:EN=VAL(LEFT$(EN$,2))
620 IF EN<20 OR EN=62 OR HF=1 THEN RETURN
625 IF EN=31 THEN CM=0:RETURN
630 PRINT"ERROR "EN:PRINTEM$:PRINT"TRACK "ET;:PRINT" SECTOR "ES
635 CLOSE15:STOP:RETURN
640 :
645 REM PRINTER SETUP
650 OPEN 5,4,0:CLOSE5:IFST=0THEN665
655 PRINT"PRINTER OFFLINE"
660 POKE198,0:WAIT198,1
665 OPEN5,4:FORP=1TO9:PRINT#5,CHR$(P(P));:NEXT:CLOSE5:RETURN